Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2017-02-13 08:45 AM
Hi all,
I wantted to set cross reference field with custom object?
Is it possible to do it
Regards
2017-02-13 08:49 AM
ilhan it's possible, what version of the framework are you on?
Advisory Consultant
2017-02-13 08:51 AM
Version 5.5
2017-02-13 01:45 PM
Thanks.
See how below works.
xRefRecordId variable is the tracking id of the record you want to link to the cross-reference field.
xRefFielddId variable is the field id for the cross-reference field you want to set.
<script src="./shared/scripts/controls/ReferenceField.js"></script>
<script type="text/javascript">
var xRefRecordId = [24075];
var xRefFielddId = 1234;
Sys.Application.add_load(function() {
setXrefFieldValues(xRefFielddId,xRefRecordId)
});
function setXrefFieldValues(field,values){
field = $CM._fields[xRefFielddId].clientId;
ArcherTech.UI.ReferenceField.CurrentLookupField = $find(field);
var currentField=ArcherTech.UI.ReferenceField.CurrentLookupField;
if(currentField) {
currentField.setLookedUpRecords(values);
if (currentField.get_isInDdeCondition() && Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack()) {
var endRequestHandler = function () {
ArcherTech.UI.ReferenceField.UpdateCurrentField(values);
Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(values);
};
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequestHandler);
} else {
var genericContent = ArcherTech.UI.GenericContent.GetInstance();
if (genericContent) {
var animationOptions = genericContent.get_loadingAnimationOptions();
$('body').loadingAnimation({ title: "Retrieving User", text: "Please wait, setting user", image: animationOptions.image });
}
ArcherTech.UI.ReferenceField.UpdateCurrentField(values);
}
}
}
</script>
Advisory Consultant
2017-02-20 02:10 AM
I have set the attriburtes for my Archer
xRefRecordId variable is the tracking id of the record you want to link to the cross-reference field.
xRefFielddId variable is the field id for the cross-reference field you want to set.
It didnot work
2017-02-20 02:25 AM
I want to explain my need.
User select a value from value list.
According that value I want to set a value in cross reference field automaticaly.
I thought I can use custom object.
If there is an aother way to do this I can use.
2017-02-20 08:55 AM
A few questions ilhan:
Did you get any errors in the browser console?
Is the cross-reference on the layout?
Is the cross-reference on a tab?
Advisory Consultant
2017-02-20 08:56 AM
You could use a data feed to do this as well. Otherwise a custom object is the only other way.
Advisory Consultant
2017-02-21 03:39 AM
In console it says
SCRIPT5009: 'fldId' is undefined,
Sys.Application.add_load(function() {
setXrefFieldValues(fldId,xRefRecordId)
});
I changed fldId with xRefFielddId then
I got Invalid argument error.
2017-02-21 03:40 AM
How can I do with data feed
Could you give me an example or sth ?