hi i need to display the logged in user in the text field and must save the name into the cdt .
Please follow the Screenshot
Discussion posts and replies are publicly visible
saveInto:{fv!item.employerName, a!save(cdtname.employerName, save!value)}
it wont work sandeep, its shows error
you are missing a "," ....
Employer name is not saved into CDT
The saveInto property only occurs if there is some kind of interaction with the field. In this case, the field is read only, so there's no interaction (hence why the value doesn't get saved).
The best way to think about doing this is what kind of action makes sense for saving these values. I'd suggest using the "Add Timesheet" link in order to populate the value, since the user must use that link to add a row. Here's how you can set up the dynamic link:
addRowLink: a!dynamicLink( label: "Add Timesheet", saveInto: a!save( target: ri!timeline, value: append( ri!timeline, type!Timesheet(employerName: loggedInUser()) ) ) )
Another common way to save this data is on button click, since you can also guarantee that the user will click the button to submit the form.
its also not working
According to what I can tell from this screenshot, you haven't done what Peter said needs to be done to accomplish this.
In this screenshot, you're still attempting to use a saveInto in a Read Only field, which will (by definition) never execute its save since no user interaction is possible.
Hi Mike,
i have done what peter said , but still it wont working
Swetha you are missing value field in a!dynamiclink()
see the example below
addRowlink: a!dynamicLink( label: "Add Product", value: { dtOfMft: today() }, saveInto: { a!save(local!products, append(local!products, save!value)) } )
@vamsik -- The dynamic link does not need a value when the only save being executed is within a!save(), fyi. In your example code above, the value field adds no additional functionality compared to the same code with no value field.
My only guess for why this isn't working is because you copied and pasted Peter's suggested code exactly, without actually replacing "type!Timesheet" with the type! declaration for your actual CDT as utilized in ri!timeline. I can tell this hasn't been completed correctly because it'll look quite a bit different when you've successfully added a type! declaration on the form. At the end it'll look a bit more like this:
Hi mike,
i have tryed this one too,
The example you posted above might work except you didn't fill in the value for "employeeName" in your 'type!DSR_TimeSheetLineItem' call.
That said, it might be a bit simpler to use the method Peter was recommending previously (just.. filled out correctly), in which you can ignroe the "value:" parameter and just declare the value in the a!save() call.
addRowLink: a!dynamicLink( label: "Add Timesheet", saveInto: { a!save( target: ri!timeline, value: append( ri!timeline, 'type!{urn:com:appian:types:DSR}DSR_TimeSheetLineItem'( employerName: loggedInUser() ) ) ) } )