Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2018-07-03 08:53 AM
I have an application A, which cross refers to questionnaire Q which is targeting Application T.
When I click on Add New from A, select a record from T as target, the window for new record for Q is shown.
In Q, there are 2 fields, reviewer and submitter. I wanted to "Pre-Populate" these two fields from fields in A, say:
Focal Point 1 -> Reviewer
Focal Point 2 -> Submitter
I managed to get the values using REST APIs. But, these values don't populate by default when the new questionnaire record window appears. When I save the questionnaire record, the APIs/ Custom Code runs fine, and I am able to see the user from Focal Point 1 in Reviewer.
Is it possible to populate the Reviewer (/submitter) by default when a new questionnaire record is created (without needing to click on save?)
I have attached the script in case it helps.
2018-07-03 08:59 AM
Hm, try to use
Sys.Application.add_load(function() {
}
instead of document.ready();
2018-07-03 09:01 AM
Kunal try switching $(document).ready(function(){ ... }); to Sys.Application.add_load(function() { ... });
Make sure your user selection isn't configured as drop-down as Archer doesn't populate the selections till the user clicks the down arrow.
Advisory Consultant
2018-07-15 07:58 AM
Bit Long, but please read
Did a couple of rounds of workarounds and troubleshooting.
I was running the custom object from Q, and it seemed that in a new Q record, the values from A were not obtainable (console output was saying as such). There were also conflict resolution pop-up showing, to which I believe there is no workaround (as pointed out by various posts in this forum).
So, from the record of application A (say ARec), I am now doing the following:
The following is set on the POST call to create QRec:
However, the reference to QRec is not visible from ARec, eventhough QRec is being created as required. In QRec, the related record field is correctly pointing to ARec.
When I save ARec, (using
$("#master_btnApply").click();
) , I saw the same Conflict Resolution Pop-Up. Back to square one.
So, browsed through the forum some more and went through the following post by David:
https://community.rsa.com/message/887208?commentID=887208#comment-887208
I modified the required lines to set the value of Xref to QRec from ARec.
The animation loads and then I get an Unexpected Error msg. The required QRec is being created though. And if I open ARec, the cross reference shows correctly. So:
I have attached the modified script. Please advise.