Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
4 replies
Subscribers
9 subscribers
Views
2119 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Currently in the form when it loads should check to see if there are any freight
sudhirp804
over 10 years ago
Currently in the form when it loads should check to see if there are any freight options already there and show them (as it does now) then when the user submits the form the existing freight rows in the DB should either be updated or deleted and overwritten. Could anyone let me know in how I can use the Query Database smart service and what query I should write so that existing freight row should be updated or deleted and overwritten. This query we have used earlier and in this case it deleted the existing freight detail (DELETE FROM prmprojectfreight WHERE projectid = ac!projectId and amount>0)
What we need instead of deleting the existing frieght it should be updated or deleted and overwritten in DB.
...
workflow.docx
OriginalPostID-136521
OriginalPostID-136521
Discussion posts and replies are publicly visible
0
Michael Chirlin
Appian Employee
over 10 years ago
Is this a SAIL form? What does the user interface look like?
It may be a matter of saving the ids of the lines that were deleted and using the Delete from Data Store Entities Smart Service to remove them from the database. The updated and new lines should be written to the database using the Write to Data Store Entity Smart Service.
forum.appian.com/.../Write_to_Data_Store_Entity_Smart_Service.html
forum.appian.com/.../Delete_from_Data_Store_Entities_Smart_Service.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sudhirp804
over 10 years ago
We are not using SAIL form. In this case we have added a "Write to Data to Data Store Entity" . In it the data is storing but when we update data in the grid screenshot attached it getting a duplicate row in DB instead of overwriting to DB for that record. Earlier we used Query Database Smart service (DELETE FROM prmprojectfreight WHERE projectid = ac!projectId and amount>0) after Write Project Data entity to store the project information.
and the issue is when we used this query it deleted the existing freight instead it should be updated or deleted and overwritten in DB.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sudhirp804
over 10 years ago
Any update would be helpful. I have tried Delete from Data Store Entities Smart Service to remove them from the database. Its getting me to the same page instead of deleting the record it adding a duplicate record. Could someone suggest Query Database Smart service to updated or deleted and overwritten in DB.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Andrew P Gramann
Certified Lead Developer
over 10 years ago
Does your CDT have the primary key specified using the @identifier annotation? If so, you just need to make sure to have the primary key field populated when you run the Write to Data Store Entity smart service.
Check out the documentation on defining custom data types for more information about JPA annotations:
forum.appian.com/.../Defining_a_Custom_Data_Type.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel