Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

172
Visualizações
Xrm.Navigation.openForm set lookup field automatically from the previous form

I added a new button inside my "Parcours" form that takes me to another form "Question" with a Xrm.Navigation.openForm

enter image description here

The "Question" form has a lookup field from "Parcours" that I want to populate set automatically from the previous form like this for example :

enter image description here

This is my code for my button, I want to detect the ID of the parcours automatically and set it in the new "Question" form

function NavigateQuestion(){
    var entityFormOptions = {};
entityFormOptions["entityName"] = "zs_question";
var formParameters = {};

// Set lookup column
formParameters["zs_parcours"] = ""; // I want to put the ID here from the previous form.
formParameters["zs_parcoursname"] = ""; // Name of the parcours.
formParameters["zs_parcourstype"] = "zs_parcours"; // Table name. 

Xrm.Navigation.openForm(entityFormOptions, formParameters).then(
    function (success) {
        console.log(success);
        console.log(formParameters);
    },
    function (error) {
        console.log(error);
    });


}

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You should be able to get the values and assign from the current record form itself.

Make sure to pass the formContext for latest client API methods (I put the syntax in commented code section).

// Set lookup column
formParameters["zs_parcours"] = Xrm.Page.data.entity.getId(); // or by using form context -- formContext.data.entity.getId();
formParameters["zs_parcoursname"] = Xrm.Page.getAttribute("zs_name").getValue(); // or by using form context -- formContext.getAttribute("zs_name").getValue();
formParameters["zs_parcourstype"] = "zs_parcours"; 
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda